
export default ()=>{
    var citysearch = new AMap.CitySearch()
    //实例化城市查询类  
    //自动获取用户IP，返回当前城市
    citysearch.getLocalCity(function (status, result) {
        if (status === 'complete' && result.info === 'OK') {
            if (result && result.city && result.bounds) {
                var cityinfo = result.city;
                var citybounds = result.bounds;
                document.getElementById('info').innerHTML =  cityinfo;
            }
        } else {
            document.getElementById('info').innerHTML = result.info;
        }
    })
}